import time
import pyautogui as p
time.sleep(3)
start = time.time()
while time.time() - start < 5:
    image = p.locateOnScreen("qq.png", confidence=0.9)
    if image is None : continue
    print(p.center(image))
    x, y = p.center(image)
    p.click(x, y)
